if { ![info exists ::env(XILINX_PART)] } {
  set ::env(XILINX_PART) "xc6slx25ftg256-2"
}

create_project dpsm_top . -part $::env(XILINX_PART)
set_property design_mode RTL [get_property srcset [current_run]]

add_files -norecurse "../../../src/top/dpsm_top.v"
add_files -norecurse "../../../src/top/s_reset.v"

add_files -norecurse "./system_top.v"
add_files -norecurse "./system.v"
add_files -norecurse "./system.ngc"

add_files -norecurse "./fusion_stub.v"
add_files -norecurse "./FUSION_TOP.ngc"

add_files -fileset [get_property constrset [current_run]] -norecurse {./top_v12.ucf}

set_property top  dpsm_top  [current_fileset]

update_compile_order -fileset sources_1

launch_runs -runs synth_1 -jobs 1 
wait_on_run  synth_1
 
set_property add_step Bitgen [get_runs impl_1]
launch_runs -runs impl_1 -jobs 1
wait_on_run  impl_1

launch_runs impl_1 -to_step Bitgen 
wait_on_run  impl_1

quit
